package org.example;

import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;


public class ExampleRun {

    public static void main(String[] args) throws IOException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {
        MyClassLoader myClassLoader = new MyClassLoader();
        Class aClass = myClassLoader.defineClass("org.example.Example", Generator.getModifedClass());

        Constructor constructor = aClass.getConstructor();
        Object o = constructor.newInstance();

        Method method = aClass.getMethod("run", String.class);
        method.invoke(o, "test");
    }
}
